<template>
    <div class="app-container">
        <el-form ref="searchForm" inline :model="searchForm" style="position:relative;">
            <el-row>
                <el-col :span="20">
                    <el-form-item label="所属栏目：" prop="columnId">
                        <el-cascader clearable :options="parentOpt" :props="optionProps" v-model="searchForm.columnId" change-on-select></el-cascader>
                    </el-form-item>
                    <el-form-item label="标题：" prop="title">
                        <el-input clearable v-model="searchForm.title" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="副标题：" prop="subhead">
                        <el-input clearable v-model="searchForm.subhead" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="摘要：" prop="summary">
                        <el-input clearable v-model="searchForm.summary" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-button @click="init('search')" type="primary">查询</el-button>
                </el-col>
                <el-col :span="4">
                    <el-button @click="addClick" type="primary" style="position: absolute;right: 0;">添加</el-button>
                </el-col>
            </el-row>
        </el-form>
        <el-table :data="tableData" border style="width: 100%;margin: 20px 0px;">
            <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
            <el-table-column prop="parentList" :formatter="parentListFun" label="所属栏目" align="center"></el-table-column>
            <el-table-column label="封面图" align="center">
                <template slot-scope="scope">
                    <!-- <img v-if="scope.row.coverName" :src="scope.row.showpic" width="50" height="50" alt="/图片" @click="enlargeFun(scope.row.showpic)"> -->
                    <img v-if="scope.row.coverName" :src="scope.row.coverName" width="50" height="50" alt="/图片" @click="enlargeFun(scope.row.coverName)">
                    <img v-else src="@/assets/image/default.png" width="50" height="50" alt="/图片">
                </template>
            </el-table-column>
            <el-table-column prop="title" label="标题" align="center"></el-table-column>
            <el-table-column prop="subhead" label="副标题" show-overflow-tooltip align="center"></el-table-column>
            <el-table-column prop="summary" label="摘要" show-overflow-tooltip align="center"></el-table-column>
            <el-table-column prop="author" label="作者" align="center"></el-table-column>
            <el-table-column prop="occurrenceTime" label="发生时间" align="center"></el-table-column>
            <el-table-column prop="referenceUrl" label="引用地址" align="center"></el-table-column>
            <el-table-column prop="sort" label="顺序值" align="center"></el-table-column>
            <el-table-column prop="usingStatus" :formatter="usingStatusFun" label="可用性" align="center"></el-table-column>
            <el-table-column label="操作" width="220" fixed="right" align="center">
                <template slot-scope="scope">
                    <el-button @click.stop="editClick(scope.row)" :disabled="(scope.row.usingStatus != 1)" type="primary" plain size="mini">编辑</el-button>
                    <el-button @click.stop="statusClick(scope.row)" type="warning" plain size="mini">{{(scope.row.usingStatus == 1) ? '禁用' : '启用'}}</el-button>
                    <el-button @click.stop="delClick(scope.row)" type="danger" plain size="mini">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <!-- 分页 -->
        <el-pagination @current-change="getList" layout="total, prev, pager, next, jumper" :total="pageData.totalElements"></el-pagination>
        <!-- 弹框 -->
        <el-dialog :visible.sync="showDialog" width="800px">
            <el-form ref="dataForm" :rules="rules" :model="dataForm" label-position="left" label-width="100px" style="margin: 0px 50px;">
                <el-form-item label="所属栏目：" prop="columnId">
                    <el-cascader clearable :options="parentOpt" :props="optionProps" v-model="columnId" change-on-select placeholder="必选项。请选择所属栏目" style="width: 100%;"></el-cascader>
                </el-form-item>
                <el-form-item label="封面图：" prop="coverName">
                    <el-upload class="avatar-uploader" action="" :http-request="UploadImage" :show-file-list="false" :before-upload="beforeAvatarUpload" >
                        <img v-if="imageUrl" :src="imageUrl" class="avatar" width="100%">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                </el-form-item>
                <el-form-item label="标题：" prop="title">
                    <el-input v-model="dataForm.title" placeholder="必填项。请输入标题，长度为1-30位" maxlength="30"></el-input>
                </el-form-item>
                <el-form-item label="副标题：" prop="subhead">
                    <el-input v-model="dataForm.subhead" placeholder="请输入副标题"></el-input>
                </el-form-item>
                <el-form-item label="摘要：" prop="summary">
                    <el-input v-model="dataForm.summary" placeholder="请输入摘要"></el-input>
                </el-form-item>
                <el-form-item label="作者：" prop="author">
                    <el-input v-model="dataForm.author" placeholder="请输入作者"></el-input>
                </el-form-item>
                <el-form-item label="正文内容：" prop="context">
                    <quill-editor v-model="context" ref="myQuillEditors" style="margin-bottom: 58px;" :options="editorOption" placeholder="请输入">
                    </quill-editor>
                    <!-- 文件上传input 将它隐藏-->
                    <el-upload action="" :http-request="qnUpload" ref="upload" style="display:none">
                        <el-button size="small" type="primary" id="imgInput">点击上传</el-button>
                    </el-upload>
                </el-form-item>
                <el-form-item label="发生时间：" prop="occurrenceTime">
                    <el-date-picker v-model="dataForm.occurrenceTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" style="width: 100%"></el-date-picker>
                </el-form-item>
                <el-form-item label="引用地址：" prop="referenceUrl">
                    <el-input v-model="dataForm.referenceUrl" placeholder="请输入引用地址"></el-input>
                </el-form-item>
                <el-form-item label="顺序值：" prop="sort">
                    <el-input v-model="dataForm.sort" type="number" placeholder="请输入顺序值"></el-input>
                </el-form-item>
                <el-form-item label="可用性：" prop="usingStatus">
                    <el-select v-model="dataForm.usingStatus" placeholder="请选择" style="width: 100%">
                        <el-option v-for="item in usingStatusOpt" :key="item.value" :label="item.label" :value="item.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button @click="addSubmit('dataForm')" type="primary">保存</el-button>
                    <el-button @click="cancelClick('dataForm')">取消</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>
        <!-- 图片弹框 -->
        <el-dialog :visible.sync="showPicDialog" width="1000px">
            <img :src="nowPic" alt="" style="max-width: 100%;margin: 0 auto 15px;display: inherit" />
        </el-dialog>
    </div>
</template>
<script>
import {quillEditor, Quill} from 'vue-quill-editor'
import {container, ImageExtend} from 'quill-image-extend-module'
Quill.register('modules/ImageExtend', ImageExtend)
import { findColumn, getDirColumn } from '@/api/content/column'
import { creatRecord, findRecord, updateRecord, releaseRecord, delRecord } from '@/api/content/image-text'
import { uploadPic, getPic } from '@/api/uploadPic'
import { isvalidInitNumber } from '@/utils/validate'
export default {
    name: 'Rich',
    data() {
        var InitNumber=(rule, value,callback)=>{
            if(value){
                if(isvalidInitNumber(value)){
                    callback()
                }else{
                    callback(new Error('请输入整数'))
                }
            }else{
                callback()
            }
        }
        return{
            tableData: [],
            nowTit: '',
            nowId: '',
            showDialog: false,
            dataForm: {
                author: '',
                columnId: '',
                context: '',
                coverName: '',
                occurrenceTime: '',
                referenceUrl: '',
                sort: '',
                subhead: '',
                summary: '',
                title: '',
                usingStatus: 1
            },
            rules: {
                title: [
                    { required: true, message: '请输入标题', trigger: 'blur' }
                ],
                sort: [
                    { trigger: 'blur', validator: InitNumber }
                ],
            },
            nowPage: 0,
            pageSize: 10,
            imageUrl: '',
            dominName: '',
            popStatus: 0,  //0为添加，1为修改
            pageData: {},
            showPicDialog: false,
            nowPic: '',
            searchForm: {
                columnId: [],
                title: '',
                summary: '',
                subhead: '',
            },
            columnId: [],
            editorOption: {
                // placeholder设置提示词
                placeholder: '请输入正文......',
                // modules设置工具栏
                modules: {
                    toolbar: [
                        ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
                        ["blockquote", "code-block"], // 引用  代码块
                        [{ header: 1 }, { header: 2 }], // 1、2 级标题
                        [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
                        [{ script: "sub" }, { script: "super" }], // 上标/下标
                        [{ indent: "-1" }, { indent: "+1" }], // 缩进
                        [{'direction': 'rtl'}],                         // 文本方向
                        [{ size: ["small", false, "large", "huge"] }], // 字体大小
                        [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
                        [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
                        [{ font: [] }], // 字体种类
                        [{ align: [] }], // 对齐方式
                        ["clean"], // 清除文本格式
                        ["link", "image", "video"] // 链接、图片、视频
                    ]
                }
            },
            usingStatusOpt: [
                {label: '启用', value: 1},
                {label: '禁用', value: 0}
            ],
            parentOpt: [],
            optionProps: {
                value: 'id',
                label: 'name',
                children: 'children'
            },
            context: '',
            uploadData: [],
        }
    },
    methods: {
        //默认函数
        init(params){
            const _this = this;
            if(params == 'search'){
                _this.nowPage = 0
            }
            let cid = '';
            if(this.searchForm.columnId.length != 0){
                cid = this.searchForm.columnId[this.searchForm.columnId.length - 1];
            }
            _this.tableData = [];
            //获取列表信息
            findRecord({ columnId: cid, title: this.searchForm.title, summary: this.searchForm.summary, subhead: this.searchForm.subhead, page: this.nowPage, size: this.pageSize }).then(response => {
                if(response.code == 200){
                    if(response.object){
                        _this.pageData = response.object
                        _this.tableData = response.object.content
                        // if(response.object.content){
                        //     for (const key in response.object.content) {
                        //         if(response.object.content[key].coverName){
                        //             getPic(response.object.content[key].coverName).then(res => {
                        //                 if(res.code == 200){
                        //                     response.object.content[key].showpic = res.object;
                        //                     _this.tableData.push(response.object.content[key]);
                        //                 }else{
                        //                     this.$message.error(res.message);
                        //                 }
                        //             })
                        //         }else{
                        //             response.object.content[key].showpic = '';
                        //             _this.tableData.push(response.object.content[key]);
                        //         }
                        //     }
                        // }
                    }
                }else{
                    this.$message.error(response.message);
                }
            })
        },
        columnOpt(){
            const _this = this;
            //获取列表信息
            findColumn( '', '', '', 0, 10000).then(response => {
                if(response.code == 200){
                    if(response.object){
                        if(response.object.content){
                            const arr = response.object.content;
                            _this.parentOpt = _this.getTreeData(arr);
                        }
                    }
                }else{
                    this.$message.error(response.message);
                }
            })
        },
        //递归
        getTreeData(data){
            for(var i=0;i<data.length;i++){
                if(data[i].children.length<1){
                    data[i].children=undefined;
                }else {
                    this.getTreeData(data[i].children);
                }
            }
            return data;
        },
        //添加
        addClick(){
            this.popStatus = 0;
            this.showDialog = true;
            this.dataForm.author = '';
            this.columnId = [];
            this.dataForm.columnId = '';
            this.dataForm.context = '';
            this.context = '';
            this.dataForm.coverName = '';
            this.dataForm.occurrenceTime = '';
            this.dataForm.referenceUrl = '';
            this.dataForm.sort = '';
            this.dataForm.subhead = '';
            this.dataForm.summary = '';
            this.dataForm.title = '';
            this.dataForm.usingStatus = 1;
            this.imageUrl = '';
            if(this.dataForm.id){
                delete this.dataForm.id;
            }
            // 为图片ICON绑定事件  getModule 为编辑器的内部属性
            setTimeout(()=>{
                this.$refs.myQuillEditors.quill.getModule('toolbar').addHandler('image', this.imgHandler)
                this.$refs.myQuillEditors.quill.getModule('toolbar').addHandler('video', this.videoHandler)  // 为视频ICON绑定事件
            },2000)
        },
        //其他的表单校验
        otherValidate(){
            if(!this.dataForm.columnId){
                this.$message.warning('请选择所属栏目');
                return false
            }
            if(!this.dataForm.coverName){
                this.$message.warning('请上传图片');
                return false
            }
            return true
        },
        //提交添加
        addSubmit(formName){
            let _this = this;
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    //提交
                    _this.dataForm.columnId = this.columnId[this.columnId.length - 1];
                    _this.dataForm.context = _this.context
                    //表单校验
                    _this.otherValidate();
                    if(!_this.otherValidate()){
                        return
                    }
                    // ---  编辑器start
                    // let str = _this.context;
                    // //图片
                    // _this.context.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {
                    //     for(let i=0;i<_this.uploadData.length;i++){
                    //         let captures = capture.replace(/&amp;/g,'&');
                    //         if(_this.uploadData[i].showImage == captures){
                    //             if(_this.uploadData[i].type == 'image'){
                    //                 let sub = str.indexOf('<img src="'+ capture +'">');
                    //                 str = str.replace('<img src="'+ capture +'">','');
                    //                 str = str.slice(0,sub) + '<img src="'+ _this.uploadData[i].saveImage +'">' + str.slice(sub,str.length);
                    //             }
                    //         }
                    //     }
                    // });
                    // //视频
                    // _this.context.replace(/<iframe [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {
                    //     for(let i=0;i<_this.uploadData.length;i++){
                    //         let captures = capture.replace(/&amp;/g,'&');
                    //         if(_this.uploadData[i].showImage == captures){
                    //             if(_this.uploadData[i].type == 'video'){
                    //                 let sub = str.indexOf('<iframe class="ql-video" frameborder="0" allowfullscreen="true" src="'+ capture +'"></iframe>');
                    //                 str = str.replace('<iframe class="ql-video" frameborder="0" allowfullscreen="true" src="'+ capture +'"></iframe>','');
                    //                 str = str.slice(0,sub) + '<iframe class="ql-video" frameborder="0" allowfullscreen="true" src="'+ _this.uploadData[i].saveImage +'"></iframe>' + str.slice(sub,str.length);
                    //             }
                    //         }
                    //     }
                    // });
                    // _this.dataForm.context = str;
                    // console.log(_this.dataForm,'----------------')
                    // return

                    if(_this.popStatus == 0){  //添加
                        creatRecord(_this.dataForm).then(response => {
                            if(response.code == 200){
                                this.$message.success(response.message);
                                _this.init();
                                _this.showDialog = false;
                            }else{
                                this.$message.error(response.message);
                            }
                        })
                    }else if(_this.popStatus == 1){  //修改
                        _this.dataForm.id = _this.nowId;
                        updateRecord(_this.dataForm).then(response => {
                            if(response.code == 200){
                                this.$message.success(response.message);
                                _this.init();
                                _this.showDialog = false;
                            }else{
                                this.$message.error(response.message);
                            }
                        })
                    }
                    
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },
        //删
        delClick(row){
            let _this = this;
            this.$confirm('确定删除 '+row.title+' 吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                //删除
                delRecord({id: row.id}).then(response => {
                    if(response.code == 200){
                        this.$message.success(response.message);
                        _this.init();
                    }else{
                        this.$message.error(response.message);
                    }
                })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消'
                });          
            });
        },
        //编辑
        editClick(row){
            this.popStatus = 1;
            this.nowId = row.id;
            this.dataForm.author = row.author;
            this.dataForm.columnId = row.columnId;
            this.context = row.context;
            this.dataForm.coverName = row.coverName;
            this.dataForm.occurrenceTime = row.occurrenceTime;
            this.dataForm.referenceUrl = row.referenceUrl;
            this.dataForm.sort = row.sort;
            this.dataForm.subhead = row.subhead;
            this.dataForm.summary = row.summary;
            this.dataForm.title = row.title;
            this.dataForm.usingStatus = row.usingStatus;
            //处理所属项目id
            if(row.parentList){
                let arr = [];
                for (const key in row.parentList) {
                    if (row.parentList.hasOwnProperty(key)) {
                        const element = row.parentList[key];
                        arr.push(element.id);
                    }
                }
                this.columnId = arr;
            }
            // if(row.coverName){
            //     this.imageUrl = row.showpic;
            // }else{
            //     this.imageUrl = '';
            // }
            this.imageUrl = row.coverName
            this.showDialog = true
            setTimeout(()=>{
                this.$refs.myQuillEditors.quill.getModule('toolbar').addHandler('image', this.imgHandler)
                this.$refs.myQuillEditors.quill.getModule('toolbar').addHandler('video', this.videoHandler)  // 为视频ICON绑定事件
            },2000)
        },
        //取消
        cancelClick(formName){
            this.showDialog = false;
            this.$refs[formName].resetFields();
        },
        //自定义上传
        UploadImage(param){
            const _this = this;
            //获取所属栏目的存储位置
            if(_this.columnId.length != 0){
                getDirColumn(_this.columnId[_this.columnId.length - 1]).then(response => {
                    if(response.code == 200){
                        //上传图片
                        let formData = new FormData();
                        formData.append('photoFile', param.file);
                        formData.append('dir', response.object);
                        formData.append('fileType', '1');
                        uploadPic(formData).then(response => {
                            if(response.code == 200){
                                _this.dataForm.coverName = response.object.saveImage;
                                this.imageUrl = response.object.showImage;
                            }else{
                                this.$message.error(response.message);
                            }
                        })
                    }else{
                        this.$message.error(response.message);
                    }
                })
            }else{
                this.$message.warning('请先选择所属栏目');
            }
        },
        //准备上传
        beforeAvatarUpload(file){
            const isJPG = file.type;
            const isLt2M = file.size / 1024 / 1024 < 5;
            if(((isJPG === 'image/jpeg') || (isJPG === 'image/png') || (isJPG === 'image/jpg') || (isJPG === 'image/gif') || (isJPG === 'image/JPEG') || (isJPG === 'image/PNG') || (isJPG === 'image/JPG') || (isJPG === 'image/GIF')) == false){
                this.$message.error('上传图片只能是 jpeg、png、jpg、gif 格式!');
            }
            if (!isLt2M) {
                this.$message.error('上传图片大小不能超过 5MB!');
            }
            return isJPG && isLt2M;
        },
        //启用禁用
        statusClick(row){
            let usingStatus,isUsing;
            if(row.usingStatus == 1){  //启用状态
                usingStatus = 0;
                isUsing = '禁用';
            }else{
                usingStatus = 1;
                isUsing = '启用';
            }
            let _this = this;
            this.$confirm('确定修改状态为 '+ isUsing +' 吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                //启用禁用
                releaseRecord({id: row.id, usingStatus: usingStatus}).then(response => {
                    if(response.code == 200){
                        this.$message.success(response.message);
                        _this.init();
                    }else{
                        this.$message.error(response.message);
                    }
                })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消'
                });          
            });
        },
        //放大图片
        enlargeFun(pic){
            this.showPicDialog = true;
            this.nowPic = pic;
        },
        //分页
        getList(val) {
            this.nowPage = val - 1;
            this.init();
        },
        usingStatusFun(row){
            if(row.usingStatus == 1){
                return '启用'
            }else if(row.usingStatus == 0){
                return '禁用'
            }
        },
        parentListFun(row){
            let str = '';
            if(row.parentList){
                for (const key in row.parentList) {
                    if (row.parentList.hasOwnProperty(key)) {
                        const element = row.parentList[key];
                        str += element.name + ' / ';
                    }
                }
            }
            return str.substr(0,str.length-3)
        },
        // 编辑器上传
        qnUpload(param,type) {
            const _this = this;
            //获取所属栏目的存储位置
            if(_this.columnId.length != 0){
                getDirColumn(_this.columnId[_this.columnId.length - 1]).then(response => {
                    if(response.code == 200){
                        //上传图片
                        let formData = new FormData();
                        formData.append('photoFile', param.file);
                        formData.append('dir', response.object);
                        if (this.uploadType === 'image') {  // 如果是点击插入图片
                            formData.append('fileType', '1');
                            return uploadPic(formData).then(re => {
                                if(re.code == 200){
                                    _this.addRange = _this.$refs.myQuillEditors.quill.getSelection();
                                    _this.uploadData.push({
                                        saveImage: re.object.saveImage,
                                        showImage: re.object.showImage,
                                        type: _this.uploadType,
                                    })
                                    _this.$refs.myQuillEditors.quill.insertEmbed(_this.addRange !== null ? _this.addRange.index : 0, _this.uploadType, re.object.saveImage, Quill.sources.USER)   // 调用编辑器的 insertEmbed 方法，插入URL
                                    let str = _this.context;
                                    let sub = str.indexOf('<img src="'+ re.object.saveImage +'">');
                                    str = str.replace('<img src="'+ re.object.saveImage +'">','');
                                    str = str.slice(0,sub) + '<img  src="'+ re.object.showImage +'">' + str.slice(sub,str.length - 1);
                                    _this.context = str;
                                    _this.$refs.myQuillEditors.quill.setSelection(_this.$refs.myQuillEditors.quill.getSelection().index+1);
                                }else{
                                    this.$message.error(re.message);
                                }
                            })
                        } else if (this.uploadType === 'video') {  // 如果是点击插入视频
                            formData.append('fileType', '2');
                            return uploadPic(formData).then(re => {
                                if(re.code == 200){
                                    _this.addRange = _this.$refs.myQuillEditors.quill.getSelection();
                                    _this.uploadData.push({
                                        saveImage: re.object.saveImage,
                                        showImage: re.object.showImage,
                                        type: _this.uploadType,
                                    })
                                    _this.$refs.myQuillEditors.quill.insertEmbed(_this.addRange !== null ? _this.addRange.index : 0, _this.uploadType, re.object.saveImage, Quill.sources.USER)   // 调用编辑器的 insertEmbed 方法，插入URL
                                    let str = _this.context;
                                    let sub = str.indexOf('<iframe class="ql-video" frameborder="0" allowfullscreen="true" src="'+ re.object.saveImage +'"></iframe>');
                                    str = str.replace('<iframe class="ql-video" frameborder="0" allowfullscreen="true" src="'+ re.object.saveImage +'"></iframe>','');
                                    str = str.slice(0,sub) + '<iframe class="ql-video" frameborder="0" allowfullscreen="true" src="'+ re.object.showImage +'"></iframe>' + str.slice(sub,str.length - 1);
                                    _this.context = str;
                                    _this.$refs.myQuillEditors.quill.setSelection(_this.$refs.myQuillEditors.quill.getSelection().index+1);
                                }else{
                                    this.$message.error(re.message);
                                }
                            })
                        }
                    }else{
                        this.$message.error(response.message);
                    }
                })
            }else{
                this.$message.warning('请先选择所属栏目');
            }
        },
        // 点击图片ICON触发事件
        imgHandler(state){
            this.Handler(state,'image');
        },
        // 点击视频ICON触发事件
        videoHandler(state){
            this.Handler(state,'video');
        },
        Handler(state,type) {
            this.addRange = this.$refs.myQuillEditors.quill.getSelection()
            if (state) {
                let fileInput = document.getElementById('imgInput')
                fileInput.click() // 加一个触发事件
            }
            this.uploadType = type
        },
    },
    mounted(){
        this.init();
        this.columnOpt();
    }
}
</script>
<style>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
</style>
